<template>
  <div style="font-family: 微软雅黑">
    <table class="table-striped">
      <tr v-for="(help, index) in helpList" :key="index">
        <td width="120px" height="30px" style="font-size: 14px">
          <div
            style="
              white-space: nowrap;
              overflow: hidden;
              text-overflow: ellipsis;
              max-width: 110px;
              float: left;
            "
          >
            <router-link
              :to="{
                path: '/Home/Help',
                query: { data: JSON.stringify(help) },
              }"
              >{{ help.title }}</router-link
            >
          </div>
        </td>
        <td width="80px" style="font-size: 9px">{{ help.publishTime }}</td>
      </tr>
    </table>
  </div>
</template>

<script>
export default {
  data() {
    return {
      helpList: [],
    };
  },
  methods: {
    getHelpList() {
      var _this = this;
      $.ajax({
        type: "get",
        url: "http://localhost:8080/forum/helplist",
        dataType: "json",
        success: function (response) {
          // console.log("nicelist", response);
          _this.helpList = response;
        },
      });
    },
  },
  mounted() {
    this.getHelpList();
  },
};
</script>

<style scoped>
.table-striped td {
  border-bottom: 1px dashed silver;
}

a:link {
  color: #525252;
  text-decoration: none;
} /* 未被访问的链接 */
a:visited {
  color: #525252;
} /*已被访问的链接 */
a:hover {
  color: red;
  text-decoration: underline;
} /* 鼠标指针移动到链接上 */
</style>